//
//  TestSlideView.m
//  庐山通
//
//  Created by zcj on 15-10-29.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "TestSlideView.h"
#import "TopSlideCell.h"
@interface TestSlideView()<UICollectionViewDataSource,UICollectionViewDelegate>

@property (nonatomic,weak)UICollectionView *TopView;
@end
@implementation TestSlideView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addCollection];
        // Initialization code
    }
    return self;
}
- (void)addCollection
{
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
    layout.itemSize = self.frame.size;
    
    UICollectionView *TopView = [[UICollectionView alloc]initWithFrame:self.bounds collectionViewLayout:layout];
    [TopView registerClass:[TopSlideCell class] forCellWithReuseIdentifier:@"topslide"];
    TopView.delegate = self;
    TopView.dataSource = self;
    [self addSubview:TopView];
    self.TopView = TopView;
}
- (void)setRelodate
{
    [self.TopView reloadData];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 29;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    TopSlideCell * cell = [TopSlideCell TopSlideCell:collectionView collectionIndex:indexPath];
    
   // cell.imagerURL = self.myPhotoData[indexPath.row];
    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
